GMAIL

Section: Maintenance Commands (8)
Updated: Local
Index Return to Main Contents
 

NAME

gmail - mail-to-Gopherspace interface  

SYNOPSIS

gmail [-c]  

DESCRIPTION

Gmail is a perl(1) script which interprets an incoming mail message and, if it is acceptable, uses it to manipulate data in a Gopher data tree.

Gmail expects a Unix-style mail message on standard input. It uses the sender of the message (as determined from the From line) to determine whether the user is authorized to manipulate Gopher data and, if so, the directory where their operations are to take place.

An authorized user can submit an item to Gopher by mailing it to gmail with the title on the Subject line and the data itself in the body of the message. Gmail will map its title into a well-formed Unix filename (with no special characters to confuse the shell) and copy the data into that file. It will also create an associated .cap file to allow gopherd(8) to map the filename back to the title. If the file already exists, gmail will overwrite it.

If the first word of the subject is delete (or DELETE or some mixed-case equivalent), gmail will generate a filename from the rest of the Subject line and delete it (as well as the associated ``.cap'' file).

Gmail performs some stylistic checking: Gopher data submitted via gmail must consist entirely of printable ASCII characters and no lines in the message body may be over 80 characters long.

When gmail puts submitted data into a file in the Gopher data tree, it inserts the title as the first line of the file (this should make it easier to index data submitted by gmail using WAIS or some other full-text index software). Gmail also appends a byline in the form:

   [Submitted by: Mojo Nixon (mojo@foo.edu)
                  Sun, 3 Jan 93 13:00:09 CST]

 

CALENDAR MODE

If gmail is invoked with a -c option, it will operate in ``calendar'' mode and will expect messages to be items for an events calendar. All operations performed in calendar mode take place in a single directory within the Gopher data tree, defined by the $caldir variable in the gmail script.

In calendar mode, gmail will attempt to parse the beginning of the Subject line (after an optional ``delete'' keyword) as a date, force it into a standard form, and use that together with the rest of the Subject line as a title. Dates are expected to be in the format yy-mm-dd or yyyy-mm-dd where yy or yyyy is the year, mm is the month and dd is the day. Gmail has a certain amount of flexibility in parsing dates; all of the following examples are equivalent:

   93-01-04: Course registration begins
   93-1-4 Course registration begins
   1993/01/04 (Mon) : Course registration begins

All of these would be turned into the following Gopher title:
   1993-01-04 (Mon): Course registration begins

 

DIAGNOSTICS

Gmail attempts to provide ample feedback to users and administrators entirely by electronic mail. All successful and unsuccessful operations result in mail being sent back to the sender, including both an explanatory message and the sender's original submission. In the case of delete operations, the deleted data is returned as well. This gives the sender a chance to catch mistakes and also to check for possible mail forgeries. The gmail administrator receives a copy in the event of errors and unauthorized admissions and, if the $debug_admin variable in the gmail script is defined, in normal successful operations as well.

In order to avoid mail loops, gmail will exit silently if it receives mail from root, postmaster or the mailer-daemon or if the subject line appears to be an error message.  

ACCESS CONTROL

Gmail uses a static file (defined by the $gmailers variable at the beginning of the perl(1) script) to determine who is authorized to use the gmail interface and where their data is to go. Each line of this ``gmailers'' file is in the following format:


   sender's-email-address [calendar] [directory]

If the ``calendar'' keyword is present, the user is authorized to submit calendar events via a gmail process running in calendar mode. If a directory is specified, the user is authorized to submit data to that directory. Only one directory may be specified per user. The format of the file also allows for blank lines and comments beginning with ``#''. Example:

   # This is a sample gmailers file.
   tjones@foo.edu /foo1/gopher-data/policy         # directory only
   nsinatra@bar.edu calendar                       # calendar only
   mojo@foo.edu calendar /foo1/gopher-data/policy  # both

 

INSTALLATION

Gmail is best installed by being invoked from a .forward file in the home directory of a pseudo-user with write permission in the portions of the Gopher data tree where gmail is to deliver data. (The .forward file must be owned by the pseudo-user or the mail system will ignore it.)

For example, consider the following /etc/passwd entries for the machine foo.edu:

   cwis:*:999:20:CWIS Operator:/foo/cwis:/bin/csh
   cwis-mail:*:999:20:CWIS Operator:/foo/cwis/cwis-mail:/bin/csh
   cwis-cal:*:999:20:CWIS Operator:/foo/cwis-cal:/bin/csh

If ~cwis-mail/.forward contains the following (the quotes are necessary):
   "| /usr/local/etc/gmail"

and ~cwis-cal/.forward contains the following:
   "| /usr/local/etc/gmail -c"

then authorized users can submit ordinary Gopher items by mailing them to ``cwis-mail@foo.edu'' and submit calendar items by mailing them to ``cwis-cal@foo.edu''.  

CONFIGURATION

The following perl(1) variables must be set according to the needs of your site at the beginning of the gmail script (see the comments in the script for more details):
@safedir
A list of directories under which it is acceptable to deliver data (usually just the root of your Gopher data tree).
$caldir
The directory where calendar data is to be placed.
$gmailers
The name of the file containing authorized users and their target directories.
$publiccal
A switch to determine whether people submitting calendar items must be authorized and listed in the $gmailers file.
$prob_admin
The electronic mail address of the Gopher administrator to be notified in case of errors and unathorized submissions.
$debug_admin
The electronic mail address of the Gopher administrator to be notified in case of normal, successful submissions.
$MAIL
The preferred mail program on your system (probably /bin/mail).
$server_name
A short descriptive name of your Gopher server.
$sig
Gopher administrator contact info.
$disclaimer
An optional disclaimer to be appended to each item saved in Gopherspace.
$UMASK
The Unix file permissions mask. Use 002 if you wish to have files created by gmail be group-writeable, 022 otherwise.
 

BUGS

Returns a copy of deleted data but not overwritten data; doesn't save a copy of either one.

Accepts a single date in calendar mode but not a range of dates.

Relies on mail to inform administrator of problems; has no logging.  

SEE ALSO

gmailcal(8), gopherd(8), perl(1)  

AUTHORS

Prentiss Riddle (riddle@rice.edu)

Some code gratefully borrowed from the audit.pl package by Martin Streicher (strike@convex.com).


 

Index

NAME
SYNOPSIS
DESCRIPTION
CALENDAR MODE
DIAGNOSTICS
ACCESS CONTROL
INSTALLATION
CONFIGURATION
BUGS
SEE ALSO
AUTHORS

This document was created by man2html, using the manual pages.
Time: 13:03:41 GMT, November 04, 2024